var xtAttachmentWinAdd;
var xtAttachmentFormAdd;
function addXtAttachment(){
	initXtAttachmentFormAdd();
	xtAttachmentWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtAttachmentFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtAttachmentFormAdd,'../xtAttachmentController/addXtAttachment',grid,xtAttachmentWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtAttachmentWinAdd.show();
}
function initXtAttachmentFormAdd(){
	xtAttachmentFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		labelWidth:50,
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'4 5 4 5'
		},
		items:[
		{
			fieldLabel:'件文类型',
			xtype:'textfield',
			name:'xt_attachmentType',
			maxLength:20,
			anchor:'100%'
		},
		{
			fieldLabel:'文件上传时间',
			xtype:'textfield',
			name:'xt_attachmentCtime',
			maxLength:20,
			anchor:'100%'
		},
		{
			fieldLabel:'件文大小',
			xtype:'textfield',
			name:'xt_attachmentSize',
			maxLength:20,
			anchor:'100%'
		},
		{
			fieldLabel:'文件路径',
			xtype:'textfield',
			name:'xt_attachmentPath',
			maxLength:200,
			anchor:'100%'
		},
		{
			fieldLabel:'0正常1删除',
			xtype:'numberfield',
			value:'0',
			name:'xt_attachmentIsDelete',
			anchor:'100%'
		},
		{
			fieldLabel:'附件名称',
			xtype:'textfield',
			name:'xt_attachmentName',
			maxLength:50,
			anchor:'100%'
		},
		{
			fieldLabel:'传上者编号',
			xtype:'textfield',
			name:'xt_userinfo_id',
			maxLength:32,
			anchor:'100%'
		},
		{
			fieldLabel:'传上模块编号',
			xtype:'textfield',
			name:'xt_modules_id',
			maxLength:32,
			anchor:'100%'
		},
		{
			fieldLabel:'顺序',
			xtype:'numberfield',
			value:'0',
			name:'xt_modules_order',
			anchor:'100%'
		}
		]
	});
}
